package com.zengqingfa.springboot.validation.demo.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author zengqingfa
 * @className UserNestedDTO
 * @description
 * @create 2022/12/17 20:57
 */
@Data
public class UserNestedDTO {

    @Min(value = 100L)
    @NotNull
    private Long userId;

    @NotNull
    @Valid
    private Job job;

    @Data
    public static class Job {

        @Min(100)
        private Long jobId;

        @NotNull
        @Length(min = 2, max = 10)
        private String jobName;
    }
}